package cn.net.dpi.core.exception;


public enum ApiError {

    SUCCESS(0, "成功"),

    ERROR(1, "系统异常，请联系管理员!"),

    FAIL(2, "失败"),

    UNAUTHORIZED(401, "用户未授权"),

    ACCESS_DENIED(403, "访问被拒绝"),

    INVOKE_UA_API_FAIL(600, "调用UA接口失败"),

    INVOKE_SA_API_FAIL(601, "调用SA接口失败"),

    REMOTE_REQUEST_FAIL(700, "远程调用失败"),

    DB_OPERATION_FAIL(800, "数据库操作失败"),

    NOT_INFO_ERROR(997, "信息不存在"),

    INVALID_USERID(998, "无效的用户"),

    INVALID_PARAM(999, "无效的参数"),


    /************************基站运维错误码1000-1999************************/
    SITE_OPS_COMMON_ERROR(1000, "基站运维操作通用错误"),

    CREATE_SITE_FAIL(1600, "新增基站失败"),
    UPDATE_SITE_FAIL(1601, "修改基站失败"),
    DELETE_SITE_FAIL(1602, "删除基站失败"),
    START_SITE_FAIL(1603, "启动基站失败"),
    STOP_SITE_FAIL(1604, "停止基站失败"),
    ACTIVATE_SITE_FAIL(1605, "激活基站失败"),
    CANCEL_SITE_FAIL(1606, "作废基站失败"),
    SITE_DOES_NOT_EXIST(1607,"基站信息不存在"),

    CREATE_GROUP_FAIL(1610, "新增分组失败"),
    UPDATE_GROUP_FAIL(1611, "修改分组失败"),
    DELETE_GROUP_FAIL(1612, "删除分组失败"),
    GROUP_IN_USE(1613, "分组使用中"),
    MAX_GROUP_LEVEL_LIMIT(1614, "分组超过最大5层限制"),
    PARENT_GROUP_NOT_EXIST(1615, "上级分组不存在"),
    GROUP_HAS_CHILD(1616, "分组包含子分组"),

    CREATE_ANTENNA_TYPE_FAIL(1620, "新增天线类型失败"),
    UPDATE_ANTENNA_TYPE_FAIL(1621, "修改天线类型失败"),
    DELETE_ANTENNA_TYPE_FAIL(1622, "删除天线类型失败"),
    ANTENNA_TYPE_IN_USE(1623, "天线类型使用中"),

    CREATE_RECEIVER_FAIL(1630, "新增接收机类型失败"),
    UPDATE_RECEIVER_FAIL(1631, "修改接收机类型失败"),
    DELETE_RECEIVER_FAIL(1632, "删除接收机类型失败"),
    RECEIVER_IN_USE(1633, "接收机类型使用中"),

    CREATE_BOARD_FAIL(1640, "新增接收机板卡失败"),
    UPDATE_BOARD_FAIL(1641, "修改接收机板卡失败"),
    DELETE_BOARD_FAIL(1642, "删除接收机板卡失败"),
    BOARD_IN_USE(1643, "接收机板卡使用中"),

    CREATE_QC_CONFIG_FAIL(1650, "新增质检配置失败"),
    UPDATE_QC_CONFIG_FAIL(1651, "修改质检配置失败"),
    DELETE_QC_CONFIG_FAIL(1652, "删除质检配置失败"),
    QC_CONFIG_IN_USE(1653, "质检配置使用中"),

    CREATE_PARTNER_FAIL(1660, "新增合作方失败"),
    UPDATE_PARTNER_FAIL(1661, "修改合作方失败"),
    DELETE_PARTNER_FAIL(1662, "删除合作方失败"),
    PARTNER_IN_USE(1663, "合作方使用中"),

    CREATE_TRIGGER_FAIL(1670, "新增触发器失败"),
    UPDATE_TRIGGER_FAIL(1671, "修改触发器失败"),
    DELETE_TRIGGER_FAIL(1672, "删除触发器失败"),
    TRIGGER_IN_USE(1673, "触发器使用中"),
    ENABLE_TRIGGER_FAIL(1674, "启用触发器失败"),
    DISABLE_TRIGGER_FAIL(1675, "停用触发器失败"),

    CREATE_HPC_FAIL(1680, "新增基站坐标失败"),
    SITE_CRS_REPEAT(1681, "基站坐标所属的基站坐标系统和类型已存在"),
    SITE_CRS_NOT_EXIST(1682, "基站坐标系统和类型不存在"),
    UPDATE_HPC_FAIL(1683, "修改基站坐标失败"),
    DELETE_HPC_FAIL(1684, "删除基站坐标失败"),

    CLEAR_ALARM_FAIL(1690, "清除告警信息失败"),
    HANDLE_ALARM_FAIL(1691, "处理报警失败"),
    START_ALARM_TASK_FAIL(1692, "启动告警任务失败"),
    STOP_ALARM_TASK_FAIL(1693, "停止报警任务失败"),

    /**********************产品异常信息2000-2099**************************/
    PRODUCT_NAME_REPEAT(2000, "产品名称已存在"),
    REDIS_UPDATE_GOODS_STOCK_ERROR(2001, "产品库存更改同步redis库存出错"),
    GOODS_MODEL_NOT_EXIST(2002, "此产品未配置基本属性信息"),
    THIS_GOODS_CODE_NON_PUTAWAY(2003, "此商品未上架"),
    THIS_TIME_VALID_ERROR(2004, "时间范围参数错误，时间范围参数不能单独存在，且开始时间应小于或等于结束时间"),
    PRODUCT_NAME_VERSION_REPEAT(2005, "相同名称下已存在此版本SDK产品"),
    /**********************购物车异常信息2100-2199**************************/
    THIS_GOODS_DOES_NOT_EXIST_IN_CART(2101, "购物车中不存在此商品"),
    THIS_CART_ADD_ORDER_EXCEPTION(2102, "购物车下单订单生成异常"),
    THIS_CART_ADD_ORDER_DETAILS_EXCEPTION(2102, "购物车下单订单详情生成异常"),
    UNSELECTED_ITEMS_IN_CART(2103, "购物车未选择商品"),
    /**********************订单异常信息2200-2299**************************/
    INSUFFICIENT_INVENTORY_OF_GOODS(2200, "所选商品库存不足"),
    THIS_GOODS_CODE_NON_EXISTENT(2201, "此商品编码的商品不存在"),
    THIS_ORDER_NON_EXISTENT(2202, "此订单编号不存在"),
    THIS_ORDER__DETAIL_PRODUCT_NON_EXISTENT(2203, "此订单下不存在此商品"),
    THIS_ORDER__DETAIL_OF_THE_ORDER_DOES_NOT_EXIST(2204, "此订单详情所属订单不存在"),
    THIS_ORDER_DOES_NOT_BELONG_TO_THIS_USER(2205, "此订单不属于该用户"),
    SUBSCRIPTIONS_CLONE_EXCEPTION(2206, "订单订阅信息克隆异常"),
    THIS_ORDER_NON_DEFERRABLE(2207, "此订单未审核完成或已申请过延期，不可申请延期"),
    EXTENSIONS_TIME_INVALID(2208, "申请延期时间无效"),
    THIS_GOODS_NON_EXISTENT(2209, "查询商品不存在"),
    GOODS_ASSIGN_NUM_OUT_OF_RANGE(2210, "商品分配数量超出许可数量范围"),
    /**********************审核异常信息2300-2399**************************/
    SDK_ORDER_AUDIT_ERROR(2300, "sdk订单审核失败，请稍后重试。"),
    REPEAT_AUDIT(2301, "已审核，不能重复审核。"),
    ORDER_AUDIT_ERROR(2302, "订单审核失败，请稍后重试。"),
    /**********************上下架异常信息2400-2499**************************/
    SHELF_TASK_NON_EXISTENT(2400, "上/下架任务不存在！"),
    ONLY_GOODS_WITH_UN_SUBMITTED_STATUS_CAN_BE_SUBMITTED(2401, "只能提交上下架状态为“未提交”的商品！"),
    ONLY_GOODS_WITH_SUBMITTED_STATUS_CAN_BE_REVOKED(2402, "只能撤销状态是“已提交”的商品！"),
    REVOKE_GOODS_NON_EXISTENT(2403, "撤销的上下架任务不存在！"),
    REVOKE_GOODS_FAIL(2404, "撤销失败！"),
    GOODS_CAN_NOT_ON_SHELF(2405, "当前商品不能上架！"),
    GOODS_CAN_NOT_OFF_SHELF(2406, "当前商品不能下架！"),
    /**********************客户认证信息2500-2599**************************/
    ACCOUNT_NON_EXIST(2500, "账号不存在"),
    USER_AUTH_REPEAT(2501, "该账号已认证或在认证中，不能重复认证！"),
    USER_AUTH_HAS_BEEN_SUBMITTED(2502, "认证信息审核中，不能重复提交审核！"),
    USER_LICENCE_NUMBER_REPEAT(2503, "营业执照号码已被认证,不能重复认证！"),
    USER_ID_CARD_NUMBER_REPEAT(2504, "身份证号已被认证,不能重复认证！"),
    QUERY_PURPOSE_DICT_FAIL(2505, "获取用途字典失败"),
    SMS_FAIL(2506, "获取短信验证码失败，请1分钟后重试"),

    /************************解算管理N-RTK错误码3000-2199************************/
    PNR_SUBNET_ID_NOT_NULL_PARAM(3000, "子网ID不能为空"),
    PNR_ERROR_CREATE_SUBNET_NO_ENOUGH_SITE_MSG(3001, "无基站或基站数量太少，无法组成子网"),
    PNR_GRID_NOT_EMPTY_ERROR(3002, "格网不能为空"),
    PNR_SUBNET_GRID_OVERRUN_ERROR(3003, "子网格网数量超限"),
    PNR_SUBNET_BUILD_TOO_OFTEN(3004, "子网构建过于频繁"),
    PNR_SUBNET_BASELINE_LENGTH_OVERRUN_ERROR(3005, "子网基线长度超限"),
    PNR_REGION_REPEAT_NAME_ERROR(3006, "分区名称已存在，请重新命名！"),
    PNR_SUBNET_SITE_NUM_OVERRUN_ERROR(3007, "子网基站数量超限，最多50个"),
    PNR_REGION_ID_NOT_NULL_PARAM(3008, "分区ID不能为空"),
    PNR_SUBNET_ID_LIST_NOT_NULL_PARAM(3009, "子网编号集合不能为空"),
    PNR_INS_REPEAT_NAME_ERROR(3010, "解算实例名称已存在，请重新命名！"),
    PNR_INS_ID_NOT_NULL_PARAM(3011, "解算实例ID不能为空"),
    PNR_SUBNET_REPEAT_NAME_ERROR(3012, "子网名称已存在，请重新命名！"),

    /************************解算管理PPP-RTK错误码3200-3399************************/
    PPR_GRID_SOLUTION_CONFIG_ALREADY(3200, "解算配置名称已存在，请重新命名！"),
    PPR_SOME_OSR_GRIDS_HAVE_BEEN_CONFIGURED(3201, "部分OSR格网已被配置，不可重复配置"),
    PPR_SAT_SYS_CODE_NOT_EMPTY(3202, "卫星系统代码不能为空"),
    PPR_GRID_ID_NOT_EMPTY(3203, "格网ID不能为空"),
    PPR_SITE_CODE_CANNOT_BE_EMPTY(3204, "基站编码不能为空"),
    PPR_SITE_PRODUCT_CONFIGURED(3205, "已在生产站配置的基站，不可在配置到监测站"),
    PPR_SITE_MONITOR_CONFIGURED(3206, "已在监测站配置的基站，不可在配置到生产站"),
    PPR_SITE_MONITOR_CONFIGURED_NO_CONFIG(3207, "已在其它格网中配置监测站的基站，不可在次配置"),

    /************************解算管理PPK错误码3400-3499************************/
    PPK_TRIANGLE_ERROR(3400,"基站三角组网错误" ),
    PPK_SUBNET_ID_NOT_EMPTY_ERROR(3401,"子网ID不能为空" ),
    PPK_LESS_THAN_THREE_SITE_ERROR(3402,"基站少于三个无法组网" ),
    PPK_SSH_ERROR(3403,"SSH连接CMD执行错误" ),
    PPK_REMOTE_SERVER_IP_ERROR(3404,"远程服务地址不存在" ),
    PPK_SUBNET_OVERRUN_ERROR(3405,"子网数量已超限，禁止新建子网，可编辑修改已有子网！" ),

    /************************统一账户权限错误码9000-9999************************/
    CREATE_USER_FAIL(9000, "新增用户失败"),
    UPDATE_USER_FAIL(9001, "修改用户失败"),
    DELETE_USER_FAIL(9002, "删除用户失败"),

    CREATE_ROLE_FAIL(9003, "新增角色失败"),
    UPDATE_ROLE_FAIL(9004, "修改角色失败"),
    DELETE_ROLE_FAIL(9005, "删除角色失败"),
    EXPORT_ROLE_FAIL(9006, "导出角色失败"),
    IMPORT_ROLE_FAIL(9007, "导入角色失败"),
    ROLE_PERMISSION_FAIL(9008, "角色分配权限失败"),

    CREATE_PROJECT_FAIL(9009, "新增应用失败"),
    UPDATE_PROJECT_FAIL(9010, "修改应用失败"),
    DELETE_PROJECT_FAIL(9011, "删除应用失败"),
    EXPORT_PROJECT_FAIL(9012, "导出应用失败"),
    IMPORT_PROJECT_FAIL(9013, "导入应用失败"),

    CREATE_DEPT_FAIL(9014, "新增部门失败"),
    UPDATE_DEPT_FAIL(9015, "修改部门失败"),
    DELETE_DEPT_FAIL(9016, "删除部门失败"),

    CREATE_DICT_FAIL(9017, "新增字典失败"),
    UPDATE_DICT_FAIL(9018, "修改字典失败"),
    DELETE_DICT_FAIL(9019, "删除字典失败"),

    CREATE_MENU_FAIL(9020, "新增菜单失败"),
    UPDATE_MENU_FAIL(9021, "修改菜单失败"),
    DELETE_MENU_FAIL(9022, "删除菜单失败"),
    EXPORT_MENU_FAIL(9023, "导出菜单失败"),
    IMPORT_MENU_FAIL(9024, "导入菜单失败"),

    NOT_SEND_PARENT_ID(9025, "未传parentId"),
    NOT_SEND_PROJECT_ID(9026, "未传projectId"),

    DICT_BY_TYPE_EXIST(9027,"当前字典类别已存在"),
    DICT_BY_NAME_EXIST(9028,"当前字典类别下的字典名称已存在"),
    DICT_BY_CODE_EXIST(9029,"当前字典码(code)已被使用"),


    PWD_WITH_OLD_PWD_IDENTICAL(9030,"新密码不能与旧密码相同"),
    OLD_PWD_INCORRECTNESS (9031,"旧密码不正确"),
    CHANGE_PWD_FAIL(9032,"修改密码失败"),

    APPID_AND_SIGN (9033,"请传入正确appId和加密的sign");



    /**
     * code 错误码，0-成功
     */
    private int code;

    /**
     * message 错误信息
     */
    private String message;

    ApiError(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}

